<?php

use app\common\model\AdminRoleModel;
use app\common\model\RoleModel;

/**
 * 获取可选择的角色
 * @return array
 */
function role_enable_list()
{
    return RoleModel::where(['status' => 1])->column("id,title");
}

function get_on_checlbox(&$params, $field, $is_unset)
{
    if (isset($params[$field])) {
        $arr = array_keys($params[$field]);
        if ($is_unset) {
            unset($params[$field]);
        }
    } else {
        $arr = [];
    }
    return $arr;
}